<!DOCTYPE html>
<html lang="zh-CN" class=" ">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <title>签名规则 - Powered by MinDoc</title>


    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta name="author" content="Minho">
    <meta name="keywords" content="jeepay文档,xxpay文档,支付系统文档,开源聚合支付系统文档,优慧付 接口文档,支付接口">
    <meta name="description" content="支付接口-">


    <link href="./static/bootstrap.min.css" rel="stylesheet">

    <link href="./static/style.min.css" rel="stylesheet">
    <link href="./static/font-awesome.min.css" rel="stylesheet">
    <link href="./static/nprogress.css" rel="stylesheet">
    <link href="./static/kancloud.css" rel="stylesheet">
    <link href="./static/jstree.css" rel="stylesheet">
    <link href="./static/mermaid.css" rel="stylesheet">
    <link href="./static/sequence-diagram-min.css" rel="stylesheet">
    <link href="./static/editormd.preview.css" rel="stylesheet">
    <link href="./static/markdown.preview.css" rel="stylesheet">
    <link href="./static/github.css" rel="stylesheet">
    <link href="./static/katex.min.css" rel="stylesheet">
    <link href="./static/print.css" media="print" rel="stylesheet">

    <script type="text/javascript">window.book = { "identify": "jeepay_api" };</script>
    <link rel="stylesheet" href="./static/layer.css" id="layuicss-skinlayercss">
</head>

<body cz-shortcut-listen="true">
    <div class="m-manual manual-mode-view manual-reader">
        <header class="navbar navbar-static-top manual-head" role="banner">
            <div class="container-fluid">
                <div class="navbar-header pull-left manual-title">
                    <span class="slidebar" id="slidebar"><i class="fa fa-align-justify"></i></span>
                    <a title="优慧付 接口文档" class="book-title">优慧付 接口文档</a>
                    <span style="font-size: 12px;font-weight: 100;"></span>
                </div>
            </div>
        </header>
        <article class="container-fluid manual-body">
            <div class="manual-left">
                <div class="manual-tab">
                    <div class="tab-navg">
                        <span data-mode="view" class="navg-item active"><i class="fa fa-align-justify"></i><b
                                class="text">目录</b></span>
                    </div>
                    <div class="tab-util">
                        <span class="manual-fullscreen-switch">
                            <b class="open fa fa-angle-right" title="展开"></b>
                            <b class="close fa fa-angle-left" title="关闭"></b>
                        </span>
                    </div>
                    <div class="tab-wrap">
                        <div class="tab-item manual-catalog">
                            <div class="catalog-list read-book-preview jstree jstree-1 jstree-default" id="sidebar"
                                role="tree" tabindex="0" aria-activedescendant="76" aria-busy="false">
                                <ul class="jstree-container-ul jstree-children jstree-wholerow-ul jstree-no-dots"
                                    role="group">
                                    <li role="treeitem" aria-selected="false" aria-level="1"
                                        aria-labelledby="466_anchor" aria-expanded="true" id="466"
                                        class="jstree-node  jstree-open">
                                        <div unselectable="on" role="presentation" class="jstree-wholerow">&nbsp;</div>
                                        <i class="jstree-icon jstree-ocl" role="presentation"></i><a
                                            class="jstree-anchor"
                                            title="支付网关" id="466_anchor"><i
                                                class="jstree-icon jstree-themeicon jstree-themeicon-hidden"
                                                role="presentation"></i>支付网关</a>
                                        <ul role="group" class="jstree-children">
                                            <li role="treeitem" aria-selected="true" aria-level="2"
                                                aria-labelledby="76_anchor" id="76" class="jstree-node  jstree-leaf">
                                                <div unselectable="on" role="presentation"
                                                    class="jstree-wholerow jstree-wholerow-clicked">&nbsp;</div><i
                                                    class="jstree-icon jstree-ocl"></i>
                                                    <a
                                                    class="jstree-anchor jstree-clicked"
                                                    href="http://123.249.21.172/1dabsb5sgav0l.html"
                                                    tabindex="-1" title="签名规则"
                                                    id="76_anchor"><i
                                                        class="jstree-icon jstree-themeicon jstree-themeicon-hidden"
                                                        role="presentation"></i>签名规则</a>
                                            </li>
                                            <li role="treeitem" aria-selected="false" aria-level="2"
                                                aria-labelledby="78_anchor" id="78" class="jstree-node  jstree-leaf">
                                                <div unselectable="on" role="presentation" class="jstree-wholerow">
                                                    &nbsp;</div><i class="jstree-icon jstree-ocl"
                                                    role="presentation"></i><a class="jstree-anchor"
                                                    href="http://123.249.21.172/1dabshnfu814r.html"
                                                    tabindex="-1" title="支付接口"
                                                    id="78_anchor"><i
                                                        class="jstree-icon jstree-themeicon jstree-themeicon-hidden"
                                                        role="presentation"></i>支付接口</a>
                                            </li>
                                            <li role="treeitem" aria-selected="false" aria-level="2"
                                                aria-labelledby="79_anchor" id="79" class="jstree-node  jstree-leaf">
                                                <div unselectable="on" role="presentation" class="jstree-wholerow">
                                                    &nbsp;</div><i class="jstree-icon jstree-ocl"
                                                    role="presentation"></i><a class="jstree-anchor"
                                                    href="http://123.249.21.172/1dabsi9nqf03e.html"
                                                    tabindex="-1" title="退款接口"
                                                    id="79_anchor"><i
                                                        class="jstree-icon jstree-themeicon jstree-themeicon-hidden"
                                                        role="presentation"></i>退款接口</a>
                                            </li>
                                        </ul>
                                    </li>
                                </ul>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
            <div class="manual-right">
                <div class="manual-article">

                    <div class="article-content">
                        <div class="article-body  markdown-body editormd-preview-container" id="page-content">
                            <article class="markdown-article-inner">
                                <div class="markdown-toc editormd-markdown-toc" style="height: 787px;">
                                    <ul class="markdown-toc-list">
                                        <li class="directory-item"><a class="directory-item-link directory-item-link-2"
                                                href="1dabsb5sgav0l.html#5qyqeq"
                                                level="2">协议规则</a></li>
                                        <li class="directory-item"><a class="directory-item-link directory-item-link-2"
                                                href="1dabsb5sgav0l.html#bzfity"
                                                level="2">参数规范</a></li>
                                        <li class="directory-item"><a class="directory-item-link directory-item-link-2"
                                                href="1dabsb5sgav0l.html#cnxkq7"
                                                level="2">签名算法</a></li>
                                    </ul>
                                </div>
                                <div class="markdown-article">
                                    <h2 id="5qyqeq" class="markdown-heading"><a name="5qyqeq"
                                            class="reference-link"></a><span
                                            class="header-link octicon octicon-link"></span>协议规则</h2>
                                    <p class="line">传输方式：采用HTTP传输(生产环境建议HTTPS)<br>提交方式：<code>POST</code> 或
                                        <code>GET</code><br>内容类型：<code>application/json</code><br>字符编码：<code>UTF-8</code><br>签名算法：<code>MD5</code>
                                    </p>
                                    <h2 id="bzfity" class="markdown-heading"><a name="bzfity"
                                            class="reference-link"></a><span
                                            class="header-link octicon octicon-link"></span>参数规范</h2>
                                    <p class="line">
                                        交易金额：默认为人民币交易，单位为分，参数值不能带小数。<br>时间参数：所有涉及时间参数均使用精确到毫秒的13位数值，如：1622016572190。时间戳具体是指从格林尼治时间1970年01月01日00时00分00秒起至现在的毫秒数。
                                    </p>
                                    <h2 id="cnxkq7" class="markdown-heading"><a name="cnxkq7"
                                            class="reference-link"></a><span
                                            class="header-link octicon octicon-link"></span>签名算法</h2>
                                    <p class="line"><code>签名生成的通用步骤如下</code></p>
                                    <p class="line"><strong><em>第一步：</em></strong>
                                        设所有发送或者接收到的数据为集合M，将集合M内非空参数值的参数按照参数名ASCII码从小到大排序（字典序），使用URL键值对的格式（即key1=value1&amp;key2=value2…）拼接成字符串stringA。<br>特别注意以下重要规则：<br>◆
                                        参数名ASCII码从小到大排序（字典序）；<br>◆ 如果参数的值为空不参与签名；<br>◆ 参数名区分大小写；<br>◆
                                        验证调用返回或支付中心主动通知签名时，传送的sign参数不参与签名，将生成的签名与该sign值作校验。<br>◆
                                        支付中心接口可能增加字段，验证签名时必须支持增加的扩展字段</p>
                                    <p class="line"><strong><em>第二步：</em></strong>
                                        在stringA最后拼接上key<code>[即 StringA +"&amp;key=" + 私钥 ]</code>
                                        得到stringSignTemp字符串，并对stringSignTemp进行MD5运算，再将得到的字符串所有字符转换为大写，得到sign值signValue。
                                    </p>
                                    <p class="line">如请求支付系统参数如下：</p>
                                    <pre
                                        class="hljs javascript"><code class="language-java">        <span class="hljs-built_in"><span class="hljs-built_in">Map</span></span>&lt;<span class="hljs-built_in"><span class="hljs-built_in">String</span></span>, <span class="hljs-built_in"><span class="hljs-built_in">Object</span></span>&gt; paramsMap = <span class="hljs-keyword"><span class="hljs-keyword">new</span></span> HashMap&lt;&gt;();
        paramsMap.put(<span class="hljs-string"><span class="hljs-string">"mchNo"</span></span>, <span class="hljs-string"><span class="hljs-string">"M1682391685"</span></span>);                   <span class="hljs-comment"><span class="hljs-comment">// 商户号</span></span>
        paramsMap.put(<span class="hljs-string"><span class="hljs-string">"appId"</span></span>, <span class="hljs-string"><span class="hljs-string">"6447428682ca7458118af79f"</span></span>);      <span class="hljs-comment"><span class="hljs-comment">// 应用ID</span></span>
        paramsMap.put(<span class="hljs-string"><span class="hljs-string">"mchOrderNo"</span></span>, <span class="hljs-string"><span class="hljs-string">"mho1694051705945"</span></span>);         <span class="hljs-comment"><span class="hljs-comment">// 商户订单号</span></span>
        paramsMap.put(<span class="hljs-string"><span class="hljs-string">"wayCode"</span></span>, <span class="hljs-string"><span class="hljs-string">"ALI_BAR"</span></span>);                     <span class="hljs-comment"><span class="hljs-comment">// 支付方式</span></span>
        paramsMap.put(<span class="hljs-string"><span class="hljs-string">"amount"</span></span>, <span class="hljs-number"><span class="hljs-number">1</span></span>L);                             <span class="hljs-comment"><span class="hljs-comment">// 金额，单位分</span></span>
        paramsMap.put(<span class="hljs-string"><span class="hljs-string">"currency"</span></span>, <span class="hljs-string"><span class="hljs-string">"CNY"</span></span>);                        <span class="hljs-comment"><span class="hljs-comment">// 币种，目前只支持cny</span></span>
        paramsMap.put(<span class="hljs-string"><span class="hljs-string">"clientIp"</span></span>, <span class="hljs-string"><span class="hljs-string">"192.166.1.132"</span></span>);              <span class="hljs-comment"><span class="hljs-comment">// 发起支付请求客户端的IP地址</span></span>
        paramsMap.put(<span class="hljs-string"><span class="hljs-string">"subject"</span></span>, <span class="hljs-string"><span class="hljs-string">"商品标题"</span></span>);                     <span class="hljs-comment"><span class="hljs-comment">// 商品标题</span></span>
        paramsMap.put(<span class="hljs-string"><span class="hljs-string">"body"</span></span>, <span class="hljs-string"><span class="hljs-string">"商品描述"</span></span>);                        <span class="hljs-comment"><span class="hljs-comment">// 商品描述</span></span>
        paramsMap.put(<span class="hljs-string"><span class="hljs-string">"notifyUrl"</span></span>, <span class="hljs-string"><span class="hljs-string">"https://pay.hnmaster.cn"</span></span>);   <span class="hljs-comment"><span class="hljs-comment">// 异步通知地址</span></span>
        paramsMap.put(<span class="hljs-string"><span class="hljs-string">"reqTime"</span></span>, <span class="hljs-string"><span class="hljs-string">"1694051706"</span></span>);                  <span class="hljs-comment"><span class="hljs-comment">// 请求时间</span></span>
        paramsMap.put(<span class="hljs-string"><span class="hljs-string">"version"</span></span>, <span class="hljs-string"><span class="hljs-string">"1.0"</span></span>);                         <span class="hljs-comment"><span class="hljs-comment">// 接口版本号，固定：1.0</span></span>
        paramsMap.put(<span class="hljs-string"><span class="hljs-string">"signType"</span></span>, <span class="hljs-string"><span class="hljs-string">"MD5"</span></span>);                        <span class="hljs-comment"><span class="hljs-comment">// 签名类型</span></span>
        paramsMap.put(<span class="hljs-string"><span class="hljs-string">"channelExtra"</span></span>, <span class="hljs-string"><span class="hljs-string">"{\"authCode\":\"284957415846666792\"}"</span></span>);  <span class="hljs-comment"><span class="hljs-comment">// 渠道参数</span></span></code></pre>
                                    <p class="line">
                                        <code>待签名值</code>：<br>amount=1&amp;appId=6447428682ca7458118af79f&amp;body=商品描述&amp;channelExtra={“authCode”:”284957415846666792”}&amp;clientIp=192.166.1.132&amp;currency=CNY&amp;mchNo=M1682391685&amp;mchOrderNo=mho1694051705945&amp;notifyUrl=<a
                                            href="https://www.jeequan.xn--com&amp;reqtime=1694051706&amp;signtype=md5&amp;subject=&amp;version=1-op28g16j2s41ajxqw.0&amp;waycode=ali_bar&amp;key=unpeetkvmpqc9odlbr9s2x7u92k462h3zhhiy7hj4xbw23piwhmv6tcaq2vh8pzynzxzyo9n6puxhkahg7li6lzi8ipaqrshzydnbll64iklb4u59ggiyctahjeqffiw/"
                                            target="_blank">https://pay.hnmaster.cn&amp;reqTime=1694051706&amp;signType=MD5&amp;subject=商品标题&amp;version=1.0&amp;wayCode=ALI_BAR&amp;key=UNpEETkvMpqC9oDLBr9S2X7U92k462h3zhHiy7hj4xbw23PiWhMv6TCAQ2vh8PzynZXZYo9n6puxHkAHG7li6LZi8IpaQrshzydnBll64iKlb4U59ggiyCTaHJeqffiW</a>
                                    </p>
                                    <p class="line"><code>签名结果</code>：924065BA077FA461A9B06D2E76E9ED3C </p>
                                    <p class="line">
                                        <code>最终请求支付系统参数</code>：<br>{“amount”:1,”mchOrderNo”:”mho1694051705945”,”subject”:”商品标题”,”wayCode”:”ALI_BAR”,”sign”:”924065BA077FA461A9B06D2E76E9ED3C”,”reqTime”:”1694051706”,”body”:”商品描述”,”version”:”1.0”,”channelExtra”:”{"authCode":"284957415846666792"}”,”appId”:”6447428682ca7458118af79f”,”clientIp”:”192.166.1.132”,”notifyUrl”:”<a
                                            href="https://pay.hnmaster.cn&quot;,&quot;signtype&quot;:&quot;md5&quot;,&quot;currency&quot;:&quot;cny&quot;,&quot;mchno&quot;:&quot;M1682391685&quot;}/"
                                            target="_blank">https://pay.hnmaster.cn","signType":"MD5","currency":"CNY","mchNo":"M1682391685"}</a>
                                    </p>
                                    <p class="line">&gt; 运营管理平台可以管理商户的私钥</p>
                                    <div class="wiki-bottom"></div>
                                </div>









                            </article>
                        </div>

                        <div class="jump-top">
                            <a href="javascript:;" class="view-backtop"><i class="fa fa-arrow-up"
                                    aria-hidden="true"></i></a>
                        </div>
                    </div>

                </div>
            </div>
            <div class="manual-progress"><b class="progress-bar"></b></div>
            <div id="manual-vsplitbar" unselectable="on"
                style="                        z-index:301;                        position: absolute;                        user-select: none;                        cursor: col-resize;                        left: 275px;                        height: 100%;                        display: block;                        width: 3px;">
                <a href="javascript:void(0)" accesskey="" tabindex="0" title="vsplitbar"></a> </div>
        </article>
        <div class="manual-mask"></div>
    </div>


    

    <script src="./static/jquery.min.js"></script>
    <script src="./static/bootstrap.min.js"></script>
    <script src="./static/jquery.form.js" type="text/javascript"></script>
    <script src="./static/layer.js" type="text/javascript"></script>
    <script src="./static/jstree.min.js" type="text/javascript"></script>
    <script src="./static/nprogress.js" type="text/javascript"></script>
    <script src="./static/highlight.js" type="text/javascript"></script>
    <script src="./static/jquery.highlight.js" type="text/javascript"></script>
    <script src="./static/kancloud.js" type="text/javascript"></script>
    <script src="./static/splitbar.js" type="text/javascript"></script>
    <script type="text/javascript">
    </script>


</body>

</html>